﻿<src:OverlayWindow x:Class="GW2PAO.Views.WvWNotification.WvWNotificationWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:src="clr-namespace:GW2PAO.Views"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
        xmlns:core="clr-namespace:GW2PAO.PresentationCore;assembly=GW2PAO.PresentationCore"
        xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
        xmlns:view="clr-namespace:GW2PAO.Views.WvWNotification"
        WindowStyle="None" AllowsTransparency="true" Background="Transparent"
        ResizeMode="NoResize"
        Topmost="True" ShowInTaskbar="False"
        TextOptions.TextFormattingMode="Display"
        MinHeight="216" Height="Auto" SizeToContent="Height" Width="215"
        MouseLeftButtonDown="Window_MouseLeftButtonDown">

    <src:OverlayWindow.Resources>
        <core:AutoRefreshCollectionViewSource Source="{Binding WvWNotifications}" x:Key="WvWNotificationsCollection" />
    </src:OverlayWindow.Resources>

    <!--<Border BorderBrush="Black" BorderThickness="1">-->
    <!--See code behind for DataContext/ViewModel details-->
    <ItemsControl ItemsSource="{Binding Source={StaticResource WvWNotificationsCollection}}">

        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <StackPanel Orientation="Vertical">

                    <StackPanel.LayoutTransform>
                        <RotateTransform Angle="180"/>
                    </StackPanel.LayoutTransform>

                    <i:Interaction.Behaviors>
                        <ei:FluidMoveBehavior Duration="0:0:0.5" AppliesTo="Children">
                            <ei:FluidMoveBehavior.EaseY>
                                <CubicEase EasingMode="EaseInOut"/>
                            </ei:FluidMoveBehavior.EaseY>
                            <ei:FluidMoveBehavior.EaseX>
                                <CubicEase EasingMode="EaseInOut"/>
                            </ei:FluidMoveBehavior.EaseX>
                        </ei:FluidMoveBehavior>
                    </i:Interaction.Behaviors>
                </StackPanel>
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>

        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <view:WvWNotificationView DataContext="{Binding}">
                    <view:WvWNotificationView.LayoutTransform>
                        <RotateTransform Angle="180"/>
                    </view:WvWNotificationView.LayoutTransform>
                </view:WvWNotificationView>
            </DataTemplate>
        </ItemsControl.ItemTemplate>

    </ItemsControl>
    <!--</Border>-->

</src:OverlayWindow>
